package cn.z2huo.demo.jakarta.validation.controller;

import cn.z2huo.demo.jakarta.validation.model.dto.multi.MultiAnnotationReqDTO;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>同一个元素上使用多个注解
 *
 * @author z2huo
 */
@RestController
@RequestMapping("/multi")
public class MultiAnnotationController {

    @PostMapping("/notBlank")
    public String notBlank(@Valid @RequestBody MultiAnnotationReqDTO reqDTO) {
        return "success";
    }

    @PostMapping("/notBlankAndList")
    public String notBlankAndList(@Valid @RequestBody MultiAnnotationReqDTO reqDTO) {
        return "success";
    }

}
